/// @tags: Integral
#include <algorithm>
#include <cstdio>
#include <iomanip>
#include <iostream>

using namespace std;

namespace BlueQuantum {

int const N = 8e3 + 5;

struct Ponit {
  int x, y;
} p[N];

inline int main() {
  int T, n;
  cin >> T;
  while (T--) {
    cin >> n;
    for (int i = 0; i < n; ++i) cin >> p[i].x >> p[i].y;
    int lst = 1;
    double tot = 0, s, ts = 0;
    for (int i = 2; i < n; ++i) {
      s = (double)(p[lst].x - p[0].x) * (p[i].y - p[0].y) -
          (double)(p[i].x - p[0].x) * (p[lst].y - p[0].y);
      s /= 2;
      ts += s;
      tot += (p[0].x + p[lst].x + p[i].x + p[0].y + p[lst].y + p[i].y) * s / 3;
      lst = i;
    }
    if (ts < 0) tot = -tot;
    cout << fixed << setprecision(2) << tot << '\n';
  }
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("Integral.in", "r", stdin);
  freopen("Integral.out", "w", stdout);
#endif
#endif

  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
